﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common;

namespace Ex03
{

    /// <summary>
    /// Projection Strategies:let 定义一个局部变量，原来的查询变量依然有效
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            var names = new[] { "Tom", "Dick", "Harry", "Mary", "Jay" }.AsQueryable();
            (
                from n in names
                let vowelless = n.Replace("a", "").Replace("e", "").Replace("i", "").Replace("o", "").Replace("u", "")
                where vowelless.Length > 2
                orderby vowelless
                select vowelless               // Thanks to let, n is still in scope.
            )
            .Dump();
            Console.ReadKey();
        }
    }
}
